package com.zhiyou100.review.day014.homework;

import java.io.EOFException;
import java.io.IOException;
import java.sql.SQLException;

/**
 * @packageName: Test
 * @className: com.zhiyou100.review.day014.homework
 * @Description: TODO
 * @author: yang
 * @date: 6/22/20
 */
public class Test {
    public static void main(String args[]) {
        try {
            ma(10);
            System.out.println("No Exception");
        } catch (EOFException ex1) {
            System.out.println("ex1");
        } catch (IOException ex2) {
            System.out.println("ex2");
        } catch (SQLException ex3) {
            System.out.println("ex3");

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public static void ma(int n) throws Exception {

        if (n == 1) {

            throw new IOException();

        } else if (n == 2) {

            throw new EOFException();

        } else if (n == 3) {

            throw new SQLException();

        }
    }
}

class MySuper {
    public void m() throws IOException {
    }
}

class MySub extends MySuper {

    public void m() throws EOFException {
    }
}

class MySub2 extends MySub {


    public void m() {
    }
}